Add Node.js and bun tests to release pipeline#115
Merged
cb-srinaths merged 10 commits intomasterfrom Apr 23, 2026
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
cb-alish
approved these changes
Apr 22, 2026
There was a problem hiding this comment.
PR Complexity Score: 3.4 - Simple
View Breakdown
- Lines Changed: 234
- Files Changed: 7
- Complexity Added: 18
- Raw Score: 52.68
Overview
This PR adds continuous integration and improves test and build tooling for the Chargebee library, including support for multiple Node versions and Bun. It refines test configuration with a dedicated tsconfig.test.json and new worker-bundle tests to verify ESM worker exports. It also adjusts Git ignore rules so ESM fixture scripts are tracked and slightly optimizes the release workflow.
Key Changes
- Introduces a
CIGitHub Actions workflow that runs install, build, and test across Node 20/22/24 and adds a separate job to build and test with Bun. - Enhances the release workflow by enabling npm cache for the Node setup step to speed up publishing.
- Updates
.gitignoreto keep.mjsfiles undertest/fixturesandtest/scriptsin version control while still ignoring other JS artifacts. - Adjusts the npm
testscript to use a dedicatedtsconfig.test.json, improving TypeScript/ts-node configuration isolation for tests. - Adds a worker-bundle test suite that verifies the built ESM worker bundle exports all expected webhook-related values and works correctly when loaded inside a Node worker thread (
type: 'module'). - Introduces
tsconfig.test.jsonto configure test compilation behavior and ts-node (including experimental resolver and CommonJS override for runtime).
Risks & Considerations
- The CI workflow assumes
npm ci,npm run build, andnpm testwork in all Node matrix versions and in the Bun environment; incompatibilities or missing Bun support could cause CI failures. - Worker-bundle tests depend on
esm/chargebee.esm.worker.jsbeing built; if build outputs change path or name, tests will need to be updated accordingly. - The use of
ts-nodewithexperimentalResolverand overridden module settings may mask or introduce module-resolution issues that differ from the production build configuration. - Ensuring that
.mjsfixtures are now tracked may surface previously unnoticed linting or tooling constraints on those files.
File-level change summary
| File | Change summary |
|---|---|
| .github/workflows/ci.yml | Adds a new CI workflow that runs install, build, and tests across Node 20/22/24 and under Bun. |
| .github/workflows/release.yml | Enables npm caching in the release workflow’s Node setup to speed up publish runs and fixes EOF newline. |
| .gitignore | Updates ignore rules to continue ignoring JS files while explicitly including .mjs files in test fixtures and scripts. |
| package.json | Updates the test script to use TS_NODE_PROJECT=./tsconfig.test.json for more controlled test TypeScript compilation. |
| test/fixtures/load-esm-worker-bundle.mjs | Adds an ESM worker-thread fixture that loads the built ESM worker bundle and checks for required webhook exports. |
| test/worker-bundle.test.ts | Adds mocha tests that validate the ESM worker bundle’s exports and its ability to run correctly inside a Node worker thread. |
| tsconfig.test.json | Introduces a dedicated TypeScript configuration for tests, including ts-node settings and module options. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test importing the esm worker and run tests on node 20/22/24 and Bun